package com.git.smp.utils;

public class TransUtil {
	public static byte[] intTobyte(Long a, int len)
	  {
	    byte[] b = (byte[])null;
	    b = new byte[len];
	    for (int i = 0; i < len; i++) {
	      b[(len - i - 1)] = (byte)(int)(a.longValue() >> 8 * i & 0xFF);
	    }
	    return b;
	  }

	  public static long byteToInt(byte[] b)
	  {
	    Long obj = Long.valueOf(0L);
	    for (int i = 0; i < b.length; i++) {
	      obj = Long.valueOf(obj.longValue() | (b[(b.length - i - 1)] & 0xFF) << 8 * i);
	    }
	    return obj.longValue();
	  }
}
